//**********************************************************************************
//subtractionQuiz.java
//
//Name: Gabriel Martins	de	Castro
//Class:	COMSC	110L.51
//Date: 10/08/2014
//Instructor: Dr.	Chunyan Bai
//
//Purpose: Demonstrate basic if-else statement
//***********************************************************************************

import java.util.Scanner;
//Class
public class subtractionQuiz
{
	public static void main(String[]	args)//main	method
	{
      //Step1 Generate questions randomly
      int first = (int) (Math.random()*10);
      int second =(int) (Math.random()*(first+1));
      
      //Step2 prompt the first grader for answer
      System.out.println("What is " + first + " - " + second + " = ?");
      Scanner input = new Scanner(System.in);
      int answer = input.nextInt();
      
      //Step3 Check the answer
      //Step4 print out the grades results
      if(answer == (first-second))
         System.out.println("Right Answer! Nice!");
      else
         System.out.print("Wrong Answer ):\nThe right answer would be : " + (first - second));
     
   }
}
